﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/MainPage.master" CodeFile="PlayerProfile.aspx.cs" Inherits="Teams_PlayerProfile" %>


<asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder2">   
                <div align="center" style="height: 1129px; width: 600px;">
                <br/>
                    <br/>
                
                    <asp:Label ID="nazwaZawodnika" runat="server" Text="Profil zawodnika: " 
                        Font-Bold="True" Font-Size="Larger"></asp:Label>
                    <br/><br/>
                    <asp:Image ID="Image1" runat="server" Height="230px" Width="200px" />
                    <br/>    <br/><br/>
                    <asp:MultiView ID="MultiView1" runat="server">
                    <asp:View ID="edit" runat="server">
                    <div style="height: 681px; width: 600px" align="left">
                        <table style="width: 100%; height: 457px; background-color: #e1edff;">
                            <tr>
                                <td align="left" 
                                    style="width: 120px; height: 32px; font-weight: bold; font-size: small;">
                                    Imię:</td>
                                <td style="width: 217px; height: 32px">
                                    <asp:TextBox ID="imie" runat="server"></asp:TextBox>
                                </td>
                                <td rowspan="6">
                                    
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Nazwisko:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="nazwisko" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Klub:</td>
                                <td style="width: 217px">
                                    <asp:DropDownList ID="klub" runat="server" DataTextField="nazwa" 
                                        DataValueField="id">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Pozycja:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="pozycja" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Płeć:</td>
                                <td style="width: 217px">
                                    <asp:DropDownList ID="plec" runat="server">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Miasto:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="miasto" runat="server"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Data urodzenia:</td>
                                <td style="width: 217px">
                                    <asp:DropDownList ID="rok" runat="server" Width="63px">
                                    </asp:DropDownList>
                                    <asp:DropDownList ID="miesiac" onchange="return FillDays();" runat="server" 
                                        style="margin-bottom: 0px" Width="99px">
                                    </asp:DropDownList>
                                            <asp:DropDownList id="dzien" runat="server" style="Z-INDEX: 101;" 
                                        Width="47px">
                                            </asp:DropDownList>
                                    </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    E-mail:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="email" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    GG:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="gg" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Waga:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="waga" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Wzrost:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="wzrost" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;" 
                                    id="ksywka">
                                    Ksywka:</td>
                                <td style="width: 217px">
                                    <asp:TextBox ID="ksywka" runat="server"></asp:TextBox>
                                </td>
                                <td>
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px; font-weight: bold; font-size: small;">
                                    Zainteresowania:</td>
                                <td colspan="2" rowspan="4">
                                    <asp:TextBox Rows="4" Columns="50" ID="zainteresowania" runat="server" 
                                        Height="80px" Width="443px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" style="width: 120px">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 120px">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 120px">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 120px; font-weight: bold; font-size: small;">
                                    Zdjęcie:</td>
                                <td colspan="2" align="left">
                                        <asp:FileUpload ID="zdjecie" runat="server" />
<%--                                    <input ID="zdjecie" type="file" runat="server" dir="ltr" onchange="CapturePath(this.value);"/></td>
--%>                            </tr>
                            <tr>
                                <td style="width: 120px">
                                    &nbsp;</td>
                                <td colspan="2">
                                    
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td style="width: 120px">
                                    &nbsp;</td>
                                <td colspan="2">
                                    &nbsp;</td>
                            </tr>
                            <tr>
                                <td colspan="3">
                                <div style="float:left">
                                    <asp:SqlDataSource ID="dbzawodnicy" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:ZALSConnectionString %>" 
                                        
                                        
                                        SelectCommand="SELECT     id_zawodnika, z.id_druzyny,z.imie as Imie, z.nazwisko as Nazwisko, t.nazwa AS Klub, z.pozycja as Pozycja, z.plec as Plec, z.miasto as Miasto, z.data_urodzenia as Urodzony, z.email as &quot;E-mail&quot;, z.gg as GG, z.waga as Waga, z.wzrost as Wzrost, z.ksywka as Ksywka, z.zainteresowania as Zainteresowania, z.zdjecie
FROM         ZAWODNICY AS z INNER JOIN
                      DRUZYNY AS t ON t.id_druzyny = z.id_druzyny
WHERE     (z.id_zawodnika = @id)" 
                                        ProviderName="<%$ ConnectionStrings:ZALSConnectionString.ProviderName %>">
                                        <SelectParameters>
                                            <asp:QueryStringParameter Name="id"
                                                QueryStringField="id" />
  
                                        </SelectParameters>
                                    </asp:SqlDataSource>
                                    <asp:SqlDataSource ID="dbdruzyny" runat="server" 
                                        ConnectionString="<%$ ConnectionStrings:ZALSConnectionString %>" 
                                        ProviderName="<%$ ConnectionStrings:ZALSConnectionString.ProviderName %>" 
                                        SelectCommand="SELECT [nazwa], [id_druzyny] FROM [DRUZYNY]">
                                    </asp:SqlDataSource>
                                    </div>
                                    <div style="float:right">
                                    <asp:Button ID="Button6" runat="server" Text="Idź do drużyn" Height="25px" 
                                            onclick="Button6_Click" Visible="False" Width="100px" />
                                    <asp:Button ID="Button2" runat="server" Height="25px" onclick="Button1_Click" 
                                        Text="Idź do drużyny" Width="100px" />
                                    <asp:Button ID="zapiszbutton" runat="server" Height="25px" 
                                        onclick="Button2_Click" Text="Zapisz" Width="100px" />
                                    <asp:Button ID="Button5" runat="server" Text="Deaktywuj" Height="25px" 
                                            onclick="Button5_Click1" />
                                    </div>
                                    
                                </td>
                            </tr>
                        </table>
                    </div>
                    </asp:View>
                    <asp:View ID="view" runat="server">
                        
                        <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
                            CellPadding="4" DataSourceID="dbzawodnicy" ForeColor="#333333" GridLines="None" 
                            Height="50px" Width="125px">
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
                            <RowStyle BackColor="#EFF3FB" />
                            <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <Fields>
                                <asp:BoundField DataField="Imie" HeaderText="Imie" SortExpression="Imie" />
                                <asp:BoundField DataField="Nazwisko" HeaderText="Nazwisko" 
                                    SortExpression="Nazwisko" />
                                <asp:BoundField DataField="Urodzony" DataFormatString="{0:yyy-mm-dd}" 
                                    HeaderText="Urodzony" SortExpression="Urodzony" />
                                <asp:BoundField DataField="Klub" HeaderText="Klub" SortExpression="Klub" />
                                <asp:BoundField DataField="Pozycja" HeaderText="Pozycja" 
                                    SortExpression="Pozycja" />
                                <asp:BoundField DataField="Plec" HeaderText="Plec" SortExpression="Plec" />
                                <asp:BoundField DataField="Miasto" HeaderText="Miasto" 
                                    SortExpression="Miasto" />
                                <asp:BoundField DataField="E-mail" HeaderText="E-mail" 
                                    SortExpression="E-mail" />
                                <asp:BoundField DataField="GG" HeaderText="GG" SortExpression="GG" />
                                <asp:BoundField DataField="Waga" HeaderText="Waga" SortExpression="Waga" />
                                <asp:BoundField DataField="Wzrost" HeaderText="Wzrost" 
                                    SortExpression="Wzrost" />
                                <asp:BoundField DataField="Ksywka" HeaderText="Ksywka" 
                                    SortExpression="Ksywka" />
                                <asp:BoundField DataField="Zainteresowania" HeaderText="Zainteresowania" 
                                    SortExpression="Zainteresowania" />
                            </Fields>
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:DetailsView>
                        <div>
                        <div align="right">
                            <asp:Button ID="Button3" runat="server" Text="Idź do drużyny" Height="25px" 
                                onclick="Button3_Click" Width="130px" />
                        </div>
                        <div>
                        </div>
                        <div align="left">
                            <asp:Label ID="Label1" runat="server" Text="Dodaj komentarz"></asp:Label>
                        </div>
                        <div align="left">
                            <textarea ID="TextArea1" runat="server" name="S1" 
                                style="height: 101px; width: 600px"></textarea></div>
                        <div align="right">
                            <asp:Button ID="Button4" runat="server" Height="25px" onclick="Button4_Click" 
                                Text="Dodaj komentarz" Width="130px" />
                        </div>
                        <div>
                            &nbsp;&nbsp;
                        </div>
                        <div>
                            &nbsp;&nbsp;
                        </div>                        
                        <div align="left" style="width: 600px">
                            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
                                CellPadding="4" DataKeyNames="id_komentarza" DataSourceID="dbKomentarze" 
                                ForeColor="#333333" GridLines="None" Width="600">
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <RowStyle BackColor="#EFF3FB" />
                                <Columns>
                                    <asp:BoundField DataField="autor" HeaderText="Autor" SortExpression="autor" />
                                    <asp:BoundField DataField="data" DataFormatString="{0:yyyy-MM-dd}" 
                                        HeaderText="Data" SortExpression="data" />
                                    <asp:BoundField DataField="tresc" HeaderText="Tresc" SortExpression="tresc" />
                                </Columns>
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <EditRowStyle BackColor="#2461BF" />
                                <AlternatingRowStyle BackColor="White" />
                            </asp:GridView>
                        </div>
                        <div>
                            <asp:SqlDataSource ID="dbKomentarze" runat="server" 
                                ConnectionString="<%$ ConnectionStrings:ZALSConnectionString %>" 
                                SelectCommand="SELECT [autor], [data], [tresc], [id_komentarza] FROM [KOMNETARZE] WHERE ([id_zawodnika] = @id_zawodnika) ORDER BY [data] DESC">
                                <SelectParameters>
                                    <asp:QueryStringParameter Name="id_zawodnika" QueryStringField="id" 
                                        Type="Int32" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                        </div>
                        </div>
                        <div style="text-align: right">
                        <br />
                        <br />
                        </div>
                    </asp:View>
                </asp:MultiView>
                </div>
      
</asp:Content>
